* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --accent-color: #4895ef;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --success-color: #4CAF50;
    --danger-color: #f44336;
    --warning-color: #ff9e00;
    --info-color: #4cc9f0;
    --shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    --radius: 8px;
}

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', sans-serif;
    background-color: #f0f2f5;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    color: var(--dark-color);
}

.container {
    background-color: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 1200px;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 2.2rem;
}

h3 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: var(--secondary-color);
}

.tools {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    background-color: var(--light-color);
    padding: 15px;
    border-radius: var(--radius);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.tool-section {
    padding: 10px;
    background-color: white;
    border-radius: var(--radius);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.tool-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.tool-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: white;
    border: 2px solid #dee2e6;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.tool-btn:hover {
    background-color: var(--light-color);
    border-color: var(--accent-color);
}

.tool-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.action-btn {
    padding: 8px 15px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background-color 0.3s;
    margin: 5px 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.action-btn:hover {
    background-color: var(--secondary-color);
}

.action-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

#clear {
    background-color: var(--danger-color);
}

#clear:hover {
    background-color: #d32f2f;
}

#save {
    background-color: var(--success-color);
}

#save:hover {
    background-color: #388e3c;
}

input[type="color"] {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    background-color: transparent;
    overflow: hidden;
}

.color-presets {
    display: flex;
    gap: 5px;
    margin-top: 5px;
}

.color-preset {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #dee2e6;
    transition: transform 0.2s;
}

.color-preset:hover {
    transform: scale(1.1);
    border-color: var(--dark-color);
}

input[type="range"] {
    width: 100%;
    margin: 10px 0;
}

label {
    margin-right: 5px;
}

select {
    padding: 5px 10px;
    border-radius: var(--radius);
    border: 1px solid #dee2e6;
    font-family: inherit;
    background-color: white;
    margin: 5px 0;
}

.canvas-container {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
}

canvas {
    width: 100%;
    height: 600px;
    border: 1px solid #dee2e6;
    border-radius: var(--radius);
    background-color: white;
    cursor: crosshair;
    touch-action: none;
    box-shadow: var(--shadow);
}

#text-input-container {
    position: absolute;
    background-color: white;
    border: 1px solid #dee2e6;
    padding: 10px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10;
}

#text-input {
    width: 250px;
    height: 100px;
    padding: 8px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    resize: none;
    font-family: inherit;
}

#text-submit, #text-cancel {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#text-submit {
    background-color: var(--success-color);
    color: white;
}

#text-cancel {
    background-color: var(--danger-color);
    color: white;
}

footer {
    margin-top: auto;
    text-align: center;
    padding: 10px;
    color: #666;
    font-size: 14px;
    width: 100%;
    background-color: var(--light-color);
    border-top: 1px solid #dee2e6;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .tools {
        grid-template-columns: 1fr;
    }
    
    .tool-group {
        justify-content: center;
    }
    
    canvas {
        height: 400px;
    }
} 